#pragma once
#include <map>
#include <functional>
#include "def.h"
#include "context.h"
#include "2000_topic.pb.h"



class ActionTopic
{
public:
    static bool Init();
    
public:
    static void HandleTopicDispatch(MsgData&& msg_data);

public:
    static void OnTopicUpdate(const topic_proto::Topic& topic);
    static void ListenTopicUpdate(std::int32_t topic_event, std::function<void(const topic_proto::Topic&)> listen);
private:
    static std::map<std::int32_t, std::function<void(const topic_proto::Topic&)>> m_topic_listen;
};















